package com.fr.chart.core.glyph;

import com.fr.base.background.Background;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.IntervalColorBackground;
import com.fr.base.core.IteratorChain;
import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLReadable;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.GeneralInfo;
import com.fr.chart.base.equals.Equals;
import com.fr.chart.core.ChartUtils;
import com.fr.chart.core.LineGlyph;
import com.fr.chart.plot.DataPoint;
import com.fr.chart.plot.DataSeries;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Line2D;
import java.awt.geom.Line2D.Double;
import java.awt.geom.Point2D;
import java.awt.geom.Point2D.Double;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Rectangle2D.Double;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class StockPlotGlyph extends PlotGlyph
{
  private static final long serialVersionUID = 3316033411141629460L;
  public static final int HIGH_LOW_CLOSE = 0;
  public static final int OPEN_HIGH_LOW_CLOSE = 1;
  public static final int VOLUME_HIGH_LOW_CLOSE = 2;
  public static final int VOLUME_OPEN_HIGH_LOW_CLOSE = 3;
  public static final String XML_TAG = "StockPlotGlyph";
  private int subType = 0;
  private CategoryAxisGlyph categoryAxisGlyph = null;
  private ValueAxisGlyph volumeAxisGlyph = null;
  private ValueAxisGlyph priceAxisGlyph = null;
  private TextGlyph errTextGlyph = null;
  private int highLowLineStyle = 1;
  private Color highLowLineColor = Color.gray;
  private int upBarBorderLineStyle = 1;
  private Color upBarBorderLineColor = Color.red;
  private Background upBarBackground = ColorBackground.getInstance(Color.white);
  private int downBarBorderLineStyle = 1;
  private Color downBarBorderLineColor = Color.green;
  private Background downBarBackground = ColorBackground.getInstance(Color.white);
  private LineGlyph[] highLowGlyph;
  private ShapeGlyph[] openCloseShapeGlyph;

  public void layoutAxisGlyph()
  {
    Rectangle2D localRectangle2D = getBounds();
    this.categoryAxisGlyph.dealPlotBoundsWithAxisLabel(localRectangle2D);
    this.priceAxisGlyph.dealPlotBoundsWithAxisLabel(localRectangle2D);
    if ((getSubType() == 2) || (getSubType() == 3))
      this.volumeAxisGlyph.dealPlotBoundsWithAxisLabel(localRectangle2D);
    this.categoryAxisGlyph.calculateAxisGlyph(localRectangle2D);
    this.priceAxisGlyph.calculateAxisGlyph(localRectangle2D);
    if ((getSubType() == 2) || (getSubType() == 3))
      this.volumeAxisGlyph.calculateAxisGlyph(localRectangle2D);
    setBounds(localRectangle2D);
    Background localBackground = getInfo().getBackground();
    if (localBackground instanceof IntervalColorBackground)
    {
      IntervalColorBackground localIntervalColorBackground = (IntervalColorBackground)localBackground;
      localIntervalColorBackground.setIntervalLength(this.priceAxisGlyph.getUnit() * this.priceAxisGlyph.getUnitLen());
    }
  }

  public void layoutDataSeriesGlyph()
  {
    DataSeries localDataSeries1;
    Object localObject2;
    Rectangle2D localRectangle2D = getBounds();
    int i = getSeriesSize();
    if (getErrTextGlyph() != null)
    {
      localObject1 = getErrTextGlyph();
      ((TextGlyph)localObject1).setBounds(new Rectangle2D.Double(0.0D, 0.0D, localRectangle2D.getWidth(), localRectangle2D.getHeight()));
      return;
    }
    Object localObject1 = new Line2D[getSeries(0).getDataPointCount()];
    double d1 = getCategoryAxisGlyph().getUnitLen();
    double d2 = (d1 / 10.0D > 20.0D) ? 20.0D : d1 / 10.0D;
    double d3 = (d1 / 4.0D > 80.0D) ? 80.0D : d1 / 4.0D;
    for (int j = 0; j < i; ++j)
    {
      localDataSeries1 = getSeries(j);
      int l = 0;
      for (int i1 = 0; i1 < localDataSeries1.getDataPointCount(); ++i1)
        if (!(localDataSeries1.getDataPoint(i1).isValueIsNull()))
          ++l;
      double[] arrayOfDouble1 = new double[l];
      double[] arrayOfDouble2 = new double[l];
      l = 0;
      int i2 = 0;
      int i3 = localDataSeries1.getDataPointCount();
      while (i2 < i3)
      {
        localObject2 = localDataSeries1.getDataPoint(i2);
        if (((DataPoint)localObject2).isValueIsNull())
          break label1020:
        double d6 = ((DataPoint)localObject2).getValue();
        ShapeGlyph localShapeGlyph2 = new ShapeGlyph();
        ((DataPoint)localObject2).setDrawImpl(localShapeGlyph2);
        localShapeGlyph2.getInfo().dealCondition(getSeriesCollection(), j);
        Point2D.Double localDouble = null;
        if (getSubType() == 0)
        {
          localDouble = new Point2D.Double(getCategoryAxisGlyph().getPoint2DCateAxis(i2, 0.5D).getX(), getPriceAxisGlyph().getPoint2D(d6).getY());
          if (j == 0)
            localObject1[i2] = new Line2D.Double(localDouble, localDouble);
          else if (j == 1)
            localObject1[i2].setLine(localObject1[i2].getP1(), localDouble);
          localShapeGlyph2.setShape(new Rectangle2D.Double(localDouble.getX() - d2 / 2.0D, localDouble.getY() - 2.0D, d2, 4.0D));
        }
        else if (getSubType() == 1)
        {
          localDouble = new Point2D.Double(getCategoryAxisGlyph().getPoint2DCateAxis(i2, 0.5D).getX(), getPriceAxisGlyph().getPoint2D(d6).getY());
          if (j == 1)
            localObject1[i2] = new Line2D.Double(localDouble, localDouble);
          else if (j == 2)
            localObject1[i2].setLine(localObject1[i2].getP1(), localDouble);
          if (j == 0)
            break label501:
          if (j == 3);
          localShapeGlyph2.setShape(new Rectangle2D.Double(localDouble.getX() - d2 / 2.0D, localDouble.getY() - 2.0D, d2, 4.0D));
        }
        else if (getSubType() == 2)
        {
          if (j == 0)
          {
            localDouble = new Point2D.Double(getCategoryAxisGlyph().getPoint2DCateAxis(i2, 0.5D).getX(), getVolumeAxisGlyph().getPoint2D(d6).getY());
            localShapeGlyph2.setShape(new Rectangle2D.Double(localDouble.getX() - d3 / 2.0D, localDouble.getY(), d3, getVolumeAxisGlyph().getPoint2D(0.0D).getY() - localDouble.getY()));
          }
          else
          {
            localDouble = new Point2D.Double(getCategoryAxisGlyph().getPoint2DCateAxis(i2, 0.5D).getX(), getPriceAxisGlyph().getPoint2D(d6).getY());
            if (j == 1)
              localObject1[i2] = new Line2D.Double(localDouble, localDouble);
            else if (j == 2)
              localObject1[i2].setLine(localObject1[i2].getP1(), localDouble);
            localShapeGlyph2.setShape(new Rectangle2D.Double(localDouble.getX() - d2 / 2.0D, localDouble.getY() - 2.0D, d2, 4.0D));
          }
        }
        else if (getSubType() == 3)
        {
          if (j == 0)
          {
            localDouble = new Point2D.Double(getCategoryAxisGlyph().getPoint2DCateAxis(i2, 0.5D).getX(), getVolumeAxisGlyph().getPoint2D(d6).getY());
            localShapeGlyph2.setShape(new Rectangle2D.Double(localDouble.getX() - d3 / 2.0D, localDouble.getY(), d3, getVolumeAxisGlyph().getPoint2D(0.0D).getY() - localDouble.getY()));
          }
          else
          {
            localDouble = new Point2D.Double(getCategoryAxisGlyph().getPoint2DCateAxis(i2, 0.5D).getX(), getPriceAxisGlyph().getPoint2D(d6).getY());
            if (j == 2)
              localObject1[i2] = new Line2D.Double(localDouble, localDouble);
            else if (j == 3)
              localObject1[i2].setLine(localObject1[i2].getP1(), localDouble);
            localShapeGlyph2.setShape(new Rectangle2D.Double(localDouble.getX() - d2 / 2.0D, localDouble.getY() - 2.0D, d2, 4.0D));
          }
        }
        dealDataPointLabelBounds((DataPoint)localObject2, j);
        arrayOfDouble1[l] = localDouble.getX();
        arrayOfDouble2[l] = localDouble.getY();
        ++l;
        ++i2;
      }
      trendLineFitting(arrayOfDouble1, arrayOfDouble2, j);
    }
    if ((getSubType() == 1) || (getSubType() == 3))
    {
      label501: label1020: this.openCloseShapeGlyph = new ShapeGlyph[getSeries(0).getDataPointCount()];
      for (j = 0; j < getSeries(0).getDataPointCount(); ++j)
      {
        ShapeGlyph localShapeGlyph1;
        localDataSeries1 = getSeries((getSubType() == 1) ? 0 : 1);
        DataSeries localDataSeries2 = getSeries((getSubType() == 1) ? 3 : 4);
        double d4 = localDataSeries1.getDataPoint(j).getValue();
        double d5 = localDataSeries2.getDataPoint(j).getValue();
        if (d4 < d5)
        {
          localObject2 = new Rectangle2D.Double(getCategoryAxisGlyph().getPoint2DCateAxis(j, 0.5D).getX() - d2 / 2.0D, getPriceAxisGlyph().getPoint2D(d5).getY(), d2, getPriceAxisGlyph().getPoint2D(d4).getY() - getPriceAxisGlyph().getPoint2D(d5).getY());
          localShapeGlyph1 = new ShapeGlyph();
          this.openCloseShapeGlyph[j] = localShapeGlyph1;
          localShapeGlyph1.setBackground(this.upBarBackground);
          localShapeGlyph1.setBorderColor(this.upBarBorderLineColor);
          localShapeGlyph1.setBorderStyle(this.upBarBorderLineStyle);
          localShapeGlyph1.setShape((Shape)localObject2);
        }
        else
        {
          localObject2 = new Rectangle2D.Double(getCategoryAxisGlyph().getPoint2DCateAxis(j, 0.5D).getX() - d2 / 2.0D, getPriceAxisGlyph().getPoint2D(d4).getY(), d2, getPriceAxisGlyph().getPoint2D(d5).getY() - getPriceAxisGlyph().getPoint2D(d4).getY());
          localShapeGlyph1 = new ShapeGlyph();
          this.openCloseShapeGlyph[j] = localShapeGlyph1;
          localShapeGlyph1.setBackground(this.downBarBackground);
          localShapeGlyph1.setBorderColor(this.downBarBorderLineColor);
          localShapeGlyph1.setBorderStyle(this.downBarBorderLineStyle);
          localShapeGlyph1.setShape((Shape)localObject2);
        }
      }
    }
    this.highLowGlyph = new LineGlyph[getSeries(0).getDataPointCount()];
    for (int k = 0; k < getSeries(0).getDataPointCount(); ++k)
    {
      this.highLowGlyph[k] = new LineGlyph();
      this.highLowGlyph[k].setLineColor(getHighLowLineColor());
      this.highLowGlyph[k].setLineStyle(getHighLowLineStyle());
      this.highLowGlyph[k].setLine(localObject1[k]);
    }
  }

  public Iterator selectableChildren()
  {
    ArrayList localArrayList = new ArrayList();
    if (this.priceAxisGlyph != null)
      localArrayList.add(this.priceAxisGlyph);
    if (this.categoryAxisGlyph != null)
      localArrayList.add(this.categoryAxisGlyph);
    if (this.volumeAxisGlyph != null)
      localArrayList.add(this.volumeAxisGlyph);
    return new IteratorChain(new Iterator[] { super.selectableChildren(), localArrayList.iterator() });
  }

  public void draw(Graphics paramGraphics)
  {
    int i;
    drawInfo(paramGraphics);
    Graphics2D localGraphics2D = (Graphics2D)paramGraphics;
    localGraphics2D.translate(getBounds().getX(), getBounds().getY());
    if (this.categoryAxisGlyph != null)
      this.categoryAxisGlyph.draw(localGraphics2D);
    if (this.priceAxisGlyph != null)
      this.priceAxisGlyph.draw(localGraphics2D);
    if (this.volumeAxisGlyph != null)
      this.volumeAxisGlyph.draw(localGraphics2D);
    if (this.errTextGlyph != null)
      this.errTextGlyph.draw(localGraphics2D);
    if ((this.openCloseShapeGlyph != null) && (this.openCloseShapeGlyph.length > 0))
      for (i = 0; i < this.openCloseShapeGlyph.length; ++i)
        this.openCloseShapeGlyph[i].draw(localGraphics2D);
    if ((this.highLowGlyph != null) && (this.highLowGlyph.length > 0))
      for (i = 0; i < this.highLowGlyph.length; ++i)
        this.highLowGlyph[i].draw(localGraphics2D);
    localGraphics2D.translate(-getBounds().getX(), -getBounds().getY());
    super.draw(localGraphics2D);
  }

  public void setCategoryAxisGlyph(CategoryAxisGlyph paramCategoryAxisGlyph)
  {
    this.categoryAxisGlyph = paramCategoryAxisGlyph;
  }

  public CategoryAxisGlyph getCategoryAxisGlyph()
  {
    return this.categoryAxisGlyph;
  }

  public void setVolumeAxisGlyph(ValueAxisGlyph paramValueAxisGlyph)
  {
    this.volumeAxisGlyph = paramValueAxisGlyph;
  }

  public ValueAxisGlyph getVolumeAxisGlyph()
  {
    return this.volumeAxisGlyph;
  }

  public void setPriceAxisGlyph(ValueAxisGlyph paramValueAxisGlyph)
  {
    this.priceAxisGlyph = paramValueAxisGlyph;
  }

  public ValueAxisGlyph getPriceAxisGlyph()
  {
    return this.priceAxisGlyph;
  }

  public void setSubType(int paramInt)
  {
    this.subType = paramInt;
  }

  public int getSubType()
  {
    return this.subType;
  }

  public void setErrTextGlyph(TextGlyph paramTextGlyph)
  {
    this.errTextGlyph = paramTextGlyph;
  }

  public TextGlyph getErrTextGlyph()
  {
    return this.errTextGlyph;
  }

  public void setHighLowGlyph(LineGlyph[] paramArrayOfLineGlyph)
  {
    this.highLowGlyph = paramArrayOfLineGlyph;
  }

  public LineGlyph[] getHighLowGlyph()
  {
    return this.highLowGlyph;
  }

  public void setOpenCloseShapeGlyph(ShapeGlyph[] paramArrayOfShapeGlyph)
  {
    this.openCloseShapeGlyph = paramArrayOfShapeGlyph;
  }

  public ShapeGlyph[] getOpenCloseShapeGlyph()
  {
    return this.openCloseShapeGlyph;
  }

  public void setUpBarBorderLineStyle(int paramInt)
  {
    this.upBarBorderLineStyle = paramInt;
  }

  public int getUpBarBorderLineStyle()
  {
    return this.upBarBorderLineStyle;
  }

  public void setUpBarBorderLineColor(Color paramColor)
  {
    this.upBarBorderLineColor = paramColor;
  }

  public Color getUpBarBorderLineColor()
  {
    return this.upBarBorderLineColor;
  }

  public void setUpBarBackground(Background paramBackground)
  {
    this.upBarBackground = paramBackground;
  }

  public Background getUpBarBackground()
  {
    return this.upBarBackground;
  }

  public void setDownBarBorderLineStyle(int paramInt)
  {
    this.downBarBorderLineStyle = paramInt;
  }

  public int getDownBarBorderLineStyle()
  {
    return this.downBarBorderLineStyle;
  }

  public void setDownBarBorderLineColor(Color paramColor)
  {
    this.downBarBorderLineColor = paramColor;
  }

  public Color getDownBarBorderLineColor()
  {
    return this.downBarBorderLineColor;
  }

  public void setDownBarBackground(Background paramBackground)
  {
    this.downBarBackground = paramBackground;
  }

  public Background getDownBarBackground()
  {
    return this.downBarBackground;
  }

  public void setHighLowLineStyle(int paramInt)
  {
    this.highLowLineStyle = paramInt;
  }

  public int getHighLowLineStyle()
  {
    return this.highLowLineStyle;
  }

  public void setHighLowLineColor(Color paramColor)
  {
    this.highLowLineColor = paramColor;
  }

  public Color getHighLowLineColor()
  {
    return this.highLowLineColor;
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    int i;
    paramXMLPrintWriter.startTAG("StockPlotGlyph");
    super.writeXML(paramXMLPrintWriter);
    paramXMLPrintWriter.startTAG("Attr").attr("subType", this.subType).end();
    if (this.categoryAxisGlyph != null)
      this.categoryAxisGlyph.writeXML(paramXMLPrintWriter);
    if (this.priceAxisGlyph != null)
    {
      paramXMLPrintWriter.startTAG("Price");
      this.priceAxisGlyph.writeXML(paramXMLPrintWriter);
      paramXMLPrintWriter.end();
    }
    if (this.volumeAxisGlyph != null)
    {
      paramXMLPrintWriter.startTAG("Volume");
      this.volumeAxisGlyph.writeXML(paramXMLPrintWriter);
      paramXMLPrintWriter.end();
    }
    if (this.errTextGlyph != null)
      this.errTextGlyph.writeXML(paramXMLPrintWriter);
    if (this.highLowGlyph != null)
    {
      paramXMLPrintWriter.startTAG("HighLow");
      for (i = 0; i < this.highLowGlyph.length; ++i)
        this.highLowGlyph[i].writeXML(paramXMLPrintWriter);
      paramXMLPrintWriter.end();
    }
    if (this.openCloseShapeGlyph != null)
    {
      paramXMLPrintWriter.startTAG("OpenClose");
      for (i = 0; i < this.openCloseShapeGlyph.length; ++i)
        this.openCloseShapeGlyph[i].writeXML(paramXMLPrintWriter);
      paramXMLPrintWriter.end();
    }
    paramXMLPrintWriter.end();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    super.readXML(paramXMLableReader);
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if (str1.equals("Attr"))
      {
        String str2;
        if ((str2 = paramXMLableReader.getAttr("subType")) != null)
          this.subType = Integer.valueOf(str2).intValue();
      }
      else if (str1.equals("Price"))
      {
        this.priceAxisGlyph = ((ValueAxisGlyph)paramXMLableReader.readXMLObject(new ValueAxisGlyph()));
      }
      else if (str1.equals("Volume"))
      {
        this.volumeAxisGlyph = ((ValueAxisGlyph)paramXMLableReader.readXMLObject(new ValueAxisGlyph()));
      }
      else if (str1.equals("TextGlyph"))
      {
        this.errTextGlyph = ((TextGlyph)paramXMLableReader.readXMLObject(new TextGlyph()));
      }
      else if (str1.equals("HighLow"))
      {
        paramXMLableReader.readXMLObject(new XMLReadable(this)
        {
          private final StockPlotGlyph this$0;

          public void readXML()
          {
            String str = paramXMLableReader.getTagName();
            LineGlyph localLineGlyph = null;
            if (str.equals("LineGlyph"))
              localLineGlyph = (LineGlyph)paramXMLableReader.readXMLObject(new LineGlyph());
            if (StockPlotGlyph.access$000(this.this$0) == null)
            {
              StockPlotGlyph.access$002(this.this$0, new LineGlyph[] { localLineGlyph });
            }
            else
            {
              LineGlyph[] arrayOfLineGlyph = StockPlotGlyph.access$000(this.this$0);
              StockPlotGlyph.access$002(this.this$0, new LineGlyph[arrayOfLineGlyph.length + 1]);
              System.arraycopy(arrayOfLineGlyph, 0, StockPlotGlyph.access$000(this.this$0), 0, arrayOfLineGlyph.length);
              StockPlotGlyph.access$000(this.this$0)[arrayOfLineGlyph.length] = localLineGlyph;
            }
          }
        });
      }
      else if (str1.equals("OpenClose"))
      {
        paramXMLableReader.readXMLObject(new XMLReadable(this)
        {
          private final StockPlotGlyph this$0;

          public void readXML()
          {
            String str = paramXMLableReader.getTagName();
            ShapeGlyph localShapeGlyph = null;
            if (str.equals("ShapeGlyph"))
              localShapeGlyph = (ShapeGlyph)paramXMLableReader.readXMLObject(new ShapeGlyph());
            if (StockPlotGlyph.access$100(this.this$0) == null)
            {
              StockPlotGlyph.access$102(this.this$0, new ShapeGlyph[] { localShapeGlyph });
            }
            else
            {
              ShapeGlyph[] arrayOfShapeGlyph = StockPlotGlyph.access$100(this.this$0);
              StockPlotGlyph.access$102(this.this$0, new ShapeGlyph[arrayOfShapeGlyph.length + 1]);
              System.arraycopy(arrayOfShapeGlyph, 0, StockPlotGlyph.access$100(this.this$0), 0, arrayOfShapeGlyph.length);
              StockPlotGlyph.access$100(this.this$0)[arrayOfShapeGlyph.length] = localShapeGlyph;
            }
          }
        });
      }
    }
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof StockPlotGlyph))
      return false;
    StockPlotGlyph localStockPlotGlyph = (StockPlotGlyph)paramObject;
    if (!(super.equals(localStockPlotGlyph)))
      return false;
    if (localStockPlotGlyph.subType != this.subType)
      return false;
    if (!(Equals.equals(localStockPlotGlyph.categoryAxisGlyph, this.categoryAxisGlyph)))
      return false;
    if (!(Equals.equals(localStockPlotGlyph.priceAxisGlyph, this.priceAxisGlyph)))
      return false;
    if (!(Equals.equals(localStockPlotGlyph.volumeAxisGlyph, this.volumeAxisGlyph)))
      return false;
    if (!(Equals.equals(localStockPlotGlyph.errTextGlyph, this.errTextGlyph)))
      return false;
    if (localStockPlotGlyph.highLowGlyph.length != this.highLowGlyph.length)
      return false;
    for (int i = 0; i < localStockPlotGlyph.highLowGlyph.length; ++i)
      if (!(Equals.equals(localStockPlotGlyph.highLowGlyph[i], this.highLowGlyph[i])))
        return false;
    if (localStockPlotGlyph.openCloseShapeGlyph.length != this.openCloseShapeGlyph.length)
      return false;
    for (i = 0; i < localStockPlotGlyph.openCloseShapeGlyph.length; ++i)
      if (!(Equals.equals(localStockPlotGlyph.openCloseShapeGlyph[i], this.openCloseShapeGlyph[i])))
        return false;
    return true;
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    int i;
    StockPlotGlyph localStockPlotGlyph = (StockPlotGlyph)super.clone();
    if (this.categoryAxisGlyph != null)
      localStockPlotGlyph.categoryAxisGlyph = ((CategoryAxisGlyph)this.categoryAxisGlyph.clone());
    if (this.priceAxisGlyph != null)
      localStockPlotGlyph.priceAxisGlyph = ((ValueAxisGlyph)this.priceAxisGlyph.clone());
    if (this.volumeAxisGlyph != null)
      localStockPlotGlyph.volumeAxisGlyph = ((ValueAxisGlyph)this.volumeAxisGlyph.clone());
    if (this.errTextGlyph != null)
      localStockPlotGlyph.errTextGlyph = ((TextGlyph)this.errTextGlyph.clone());
    if ((this.highLowGlyph != null) && (this.highLowGlyph.length > 0))
    {
      localStockPlotGlyph.highLowGlyph = new LineGlyph[this.highLowGlyph.length];
      for (i = 0; i < this.highLowGlyph.length; ++i)
        localStockPlotGlyph.highLowGlyph[i] = ((LineGlyph)this.highLowGlyph[i].clone());
    }
    if ((this.openCloseShapeGlyph != null) && (this.openCloseShapeGlyph.length > 0))
    {
      localStockPlotGlyph.openCloseShapeGlyph = new ShapeGlyph[this.openCloseShapeGlyph.length];
      for (i = 0; i < this.openCloseShapeGlyph.length; ++i)
        localStockPlotGlyph.openCloseShapeGlyph[i] = ((ShapeGlyph)this.openCloseShapeGlyph[i].clone());
    }
    return localStockPlotGlyph;
  }

  public JSONObject toJSONObject()
    throws JSONException
  {
    JSONObject localJSONObject = super.toJSONObject();
    localJSONObject.put("subType", this.subType);
    localJSONObject.put("upBarBorderLineStyle", this.upBarBorderLineStyle);
    localJSONObject.put("upBarBorderLineColor", ChartUtils.color2JS(this.upBarBorderLineColor));
    localJSONObject.put("upBarBackground", this.upBarBackground.toJSONObject());
    localJSONObject.put("downBarBorderLineStyle", this.downBarBorderLineStyle);
    localJSONObject.put("downBarBorderLineColor", ChartUtils.color2JS(this.downBarBorderLineColor));
    localJSONObject.put("downBarBackground", this.downBarBackground.toJSONObject());
    localJSONObject.put("highLowLineStyle", this.highLowLineStyle);
    localJSONObject.put("highLowLineColor", ChartUtils.color2JS(this.highLowLineColor));
    if (this.categoryAxisGlyph instanceof DateAxisGlyph)
      localJSONObject.put("dateAxisGlyph", this.categoryAxisGlyph.toJSONObject());
    else if (this.categoryAxisGlyph instanceof CategoryAxisGlyph)
      localJSONObject.put("categoryAxisGlyph", this.categoryAxisGlyph.toJSONObject());
    if (this.priceAxisGlyph != null)
      localJSONObject.put("priceAxisGlyph", this.priceAxisGlyph.toJSONObject());
    if (this.volumeAxisGlyph != null)
      localJSONObject.put("volumeAxisGlyph", this.volumeAxisGlyph.toJSONObject());
    if (this.errTextGlyph != null)
      localJSONObject.put("errTextGlyph", this.errTextGlyph.toJSONObject());
    if (this.highLowGlyph != null)
      localJSONObject.put("highLowGlyph", this.highLowGlyph);
    if (this.openCloseShapeGlyph != null)
      localJSONObject.put("openCloseShapeGlyph", this.openCloseShapeGlyph);
    return localJSONObject;
  }

  public String getPlotGlyphType()
  {
    return "StockPlotGlyph";
  }

  static LineGlyph[] access$000(StockPlotGlyph paramStockPlotGlyph)
  {
    return paramStockPlotGlyph.highLowGlyph;
  }

  static LineGlyph[] access$002(StockPlotGlyph paramStockPlotGlyph, LineGlyph[] paramArrayOfLineGlyph)
  {
    return (paramStockPlotGlyph.highLowGlyph = paramArrayOfLineGlyph);
  }

  static ShapeGlyph[] access$100(StockPlotGlyph paramStockPlotGlyph)
  {
    return paramStockPlotGlyph.openCloseShapeGlyph;
  }

  static ShapeGlyph[] access$102(StockPlotGlyph paramStockPlotGlyph, ShapeGlyph[] paramArrayOfShapeGlyph)
  {
    return (paramStockPlotGlyph.openCloseShapeGlyph = paramArrayOfShapeGlyph);
  }
}